import React, { Component, PropTypes } from 'react'
import { Icon } from 'antd-mobile'

export default class NavHeader extends Component {
  render() {
    const { title, onClick } = this.props
    return (
      <header className={`cm-nav-header`}>
        <Icon
          type="left"
          onClick={onClick}
        />
        <span>{title}</span>
      </header>
    )
  }
}

NavHeader.propTypes = {
  title: PropTypes.string.isRequired,
  onClick: PropTypes.func.isRequired,
}